﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ProcurementManagement.Infrstructre;

namespace ProcurementManagement.Controllers
{
    /// <summary>
    /// 初始化数据库控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        public SqlSugarDBContext _db;
        public ValuesController(SqlSugarDBContext db)
        {
            this._db = db;
        }
        /// <summary>
        /// 初始化数据库
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public string InitDataBase()
        {
            //初始化数据库
            _db.CreateDatabase();
            return "OK";
        }
    }
}
